package com.sz.biz.app.web.api.system;

import com.sz.biz.app.web.BaseController;
import com.sz.common.base.dto.ResultDto;
import com.sz.common.core.system.entity.SysLanguage;
import com.sz.common.core.system.service.SysLanguageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Function: SysLanguageController <br>
 * Author: wentao.chang <br>
 * Date: 2016-12-20 19:37:00
 */
@Controller
@RequestMapping("/api/v1/languages")
@Api(description = " ", tags = "001、语言")
public class SysLanguageController extends BaseController {
    @Autowired
    private SysLanguageService sysLanguageService;

    /**
     * 获取所有可用语言列表
     */
    @ApiOperation(value = "获取所有可用语言列表", notes = "获取所有可用语言列表")
    @RequestMapping(value = "", method = {RequestMethod.GET})
    public
    @ResponseBody
    ResultDto getAllLanguages() {
        List<SysLanguage> langs = sysLanguageService.getLanguages();
        return new ResultDto(langs);
    }

    /**
     * 获取除过简体中文以外其他可用语言列表
     */
    @ApiOperation(value = "获取除过简体中文以外其他可用语言列表", notes = "获取除过简体中文以外其他可用语言列表")
    @RequestMapping(value = "/nozhcn", method = {RequestMethod.GET})
    public
    @ResponseBody
    ResultDto getNoSimpleChineseLanguages() {
        List<SysLanguage> langs = sysLanguageService.getNoSimpleChineseLanguages();

        return new ResultDto(langs);
    }
}
